package violentRecursion;

/*
 *@description
 *@author hkfan
 *@version 1.0
 *@create 2025/5/26 15:36
 */
public class LeetCode_55 {
    public boolean canJump(int[] nums) {
        boolean[] dp = new boolean[nums.length];
        dp[nums.length-1]=true;
        for(int i = nums.length-2;i>=0;i--){
            dp[i]=false;
            for(int  j=1;j<=nums[i];j++){
                if(i+j<nums.length && dp[i+j]){
                    dp[i]= true ;
                    break;
                }
            }
        }
        return dp[0];

    }
}
